package name.matthewgreet.example1.form; import com.opensymphony.xwork2.TextProvider; import com.opensymphony.xwork2.interceptor.ValidationAware; import name.matthewgreet.example1.common.AbstractForm; import name.matthewgreet.example1.vo.CountryVO; public class CountryForm extends AbstractForm { private static final long serialVersionUID = 8934318962457841363L; private String code; private String name; private String notes; public CountryForm() { super(); } public CountryForm(CountryVO country) { super(); if (country != null) { this.code = country.getCode(); this.name = country.getName(); this.notes = country.getNotes(); } else { this.code = ""; this.name = ""; this.notes = ""; } } @Override protected void resetFields() { code = ""; name = ""; notes = ""; } public String getCode() { return code; } public void setCode(String code) { this.code = code; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getNotes() { return notes; } public void setNotes(String notes) { this.notes = notes; } @Override public void doValidate(ValidationAware validationAware, TextProvider textProvider) { // Empty } @Override public String toString() { return "CountryForm [code=" + code + ", name=" + name + ", notes=" + notes + "]"; } }